import { METHOD, PATH } from './config'
import { request } from './core'

const APIClient = {
    install(Vue) {
        Vue.prototype.$API = this;
    },
    getBanner(params) {
        return request(METHOD.GET, PATH.getBanner, params)
    },
    getList(params) {
        return request(METHOD.GET, PATH.getList, params)
    },
    getNews(params) {
        return request(METHOD.GET, PATH.getNews, params)
    },
    getNewsData(params) {
        return request(METHOD.GET, PATH.getNewsData, params)
    },
    getDetail(params) {
        return request(METHOD.GET, PATH.getDetail, params)
    },
    getClassify(params) {
        return request(METHOD.POST, PATH.getClassify, params)
    },
    getGoodsData(params) {
        return request(METHOD.GET, PATH.getGoodsData, params)
    },
    getRequtation(params) {
        return request(METHOD.GET, PATH.getRequtation, params)
    },
    getToken(params) {
        return request(METHOD.GET, PATH.getToken, params)
    },
    getAddress(params) {
        return request(METHOD.GET, PATH.getAddress, params)
    }
}

export default APIClient